package com.kid.lib.word;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;

import com.kid.lib.word.WordBean;

public class JacobUtil1 {
	public static void main(String[] args) {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.sss");
		System.out
				.println(sdf.format(new Timestamp(System.currentTimeMillis())));

		WordBean wb = new WordBean();
		wb.startWordApp(); 
		// wb.setVisible(true);

		String img = "D:/test/1.jpg";
		String path1 = "D:/test/a.docx";
		wb.openDoc(path1);
		wb.insertJpeg(img, 0);
		wb.saveDoc();
		wb.closeDoc();

		String path2 = "D:/test/b.docx";
		wb.openDoc(path2);
		wb.insertJpeg(img, 0);
		wb.saveDoc();
		wb.closeDoc();

		for (int i = 1; i < 6; i++) {
			wb.createNewDoc();
			wb.insertText("content" + i);
			wb.insertJpeg(img, 0);
			wb.saveDocAs("D:/test/" + i + ".docx");
			wb.closeDoc();
		}

		wb.quitWordApp();
		System.out
				.println(sdf.format(new Timestamp(System.currentTimeMillis())));
	}
}
